import 'package:myturngame/bean/bagobject/bag_object.dart';
import 'package:myturngame/bean/bagobject/consume_object.dart';
import 'package:myturngame/bean/bagobject/equipment.dart';
import 'package:myturngame/bean/function/skill001_equip_function.dart';
import 'package:myturngame/bean/function/special001_equip_function.dart';
import 'package:myturngame/bean/role.dart';
import 'package:myturngame/bean/skill/skill.dart';

import '../bean/function/normal_equip_function.dart';
import '../colors.dart';

///物品创造工厂
BagObject createObject(String name) {
  if (name == "木剑") {
    return Equipment(name, Equipment.typeWeapon, "普通木剑", objectFunctions: [
      NormalEquipFunction(AttributeSet.startAttack, 1),
      NormalEquipFunction(AttributeSet.startMagicAttack, 1)
    ]);
  } else if (name == "药草") {
    return Consume(name, "治疗伤势",
        objectFunctions: [NormalEquipFunction(AttributeSet.startMaxHp, 10)]);
  } else if (name == "神之剑") {
    return Equipment(name, Equipment.typeWeapon, "毁天灭地",
        objectFunctions: List.generate(10, (index) => index + 6)
            .map((e) => NormalEquipFunction(e, 999))
            .toList());
  } else {
    return BagObject(name, "未知");
  }
}

